export const validatePassword = function (rule, password, callback) {
  if (password.length < 6) {
    callback(new Error("密码长度至少6位"));
    return;
  } else if (password.length > 16) {
    callback(new Error("密码长度至多16位"));
    return;
  }
  var pwdRegex = new RegExp("(?=.*[0-9])(?=.*[a-zA-Z]).{6,16}");

  if (!pwdRegex.test(password)) {
    callback(new Error("请输入大写字母、小写字母和数字组成的密码！"));
    return;
  }
  callback();
};
